<%= bootstrap_form_for(@author) do |f| %>
  <% if @author.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@author.errors.count, "error") %> prohibited this author from being saved:</h2>

      <ul>
      <% @author.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.text_field :username, label: "用户名" %>
  </div>
  <div class="field">
    <%= f.text_field :email, label: "邮箱" %>
  </div>
  <div class="field">
    <%= f.password_field :password, label: "密码" %>
  </div>
  <div class="field">
    <%= f.password_field :password_confirmation, label: "密码确认" %>
  </div>
  <div class="actions">
    <%= f.submit class: "btn btn-success" %>
  </div>
<% end %>
